import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const LayoutView = () => import('@/views/layout/index.vue')
const LoginView = () => import('@/views/login/index.vue')
const PastureView = () => import('@/views/pasture/index.vue')
const LifeView = () => import('@/views/life/index.vue')
const WatchView = () => import('@/views/life/watch.vue')
const ComputedView = () => import('@/views/life/computed.vue')
const VmodelView = () => import('@/views/life/Vmodel.vue')

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      children: [
        {
          path: 'welcome',
          name: 'welcome',
          component: LoginView
        },
        {
          path: 'pasture',
          name: 'pasture',
          component: PastureView
        },
        {
          path: 'life',
          name: 'life',
          component: LifeView
        },
        {
          path: 'watch',
          name: 'watch',
          component: WatchView
        },
        {
          path: 'computed',
          name: 'computed',
          component: ComputedView
        },
        {
          path: 'vmodel',
          name: 'vmodel',
          component: VmodelView
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
